using System;
using Sedge.Core.Exceptions;

namespace Sedge.Core.Utils
{
	public static class ErrorHandler
	{
		public static bool Verbose { get; set; }

		public static void Warning(string message)
		{
			if (Verbose)
			{
				Print(message);
			}
		}

		public static void Warning(string message, string parameter)
		{
			Warning(String.Format(message, parameter));
		}

		public static void Error(string message)
		{
			Print(message);
			throw new SedgeExceptionBase(message);
		}

		public static void Error(string message, string parameter)
		{
			Error(String.Format(message, parameter));
		}

		private static void Print(string message)
		{
			Console.WriteLine(message);
		}
	}
}